<include file="../Public/header" />
<div id="content" interface="favorite">
	<!-- 个人信息 -->
	<div id="i_info">
		<div id="i_info_top">
			<div id="i_info_top_ava">
				<!-- 头像 -->
				<img src="{$profile['avatar_big']}" width=80 height=80>
			</div>
			<div id="i_info_top_box">
				<div id="i_info_top_name">
					<!-- 账号昵称 -->
					{$profile['uname']}
				</div>
				<div id="i_info_top_signature">
					<php>if($profile['uid']==$_SESSION['mid']){</php>
						<div id="iitsb">
							{$profile['intro']}
						</div>
					<php>}</php>
					<!-- <div id="i_info_sendmsg" class="i_info_button">发私信</div> -->
				<php>if($profile['uid'] != $mid) { </php>
            		 <php>if(!$profile['follow_state']['following']){</php>
                        <div id="i_info_follow" class="i_info_button" linkto="{:U('w3g/Index/doFollow',array('from'=>'weibo','type'=>'follow','user_id'=>$profile['uid']))}">关注</div>
                    <php>}else {</php>
                        <div id="i_info_follow" class="i_info_button i_info_followed" linkto="{:U('w3g/Index/doFollow',array('from'=>'weibo','type'=>'unfollow','user_id'=>$profile['uid']))}">取消关注</div>
                    <php>}</php>
        		<php>}</php>
				</div>
			</div>
		</div>
		<php>
			if($profile['uid'] != $mid){
				$iicb='i_info_counts_box';
			}else{
				$iicb='i_info_counts_box_i';
			}
		</php>
		<div id="i_info_counts" act="favorite">
			<div id="i_info_counts_box_weibo" class="{$iicb}" linkto="{:U('w3g/Index/weibo','uid='.$profile['uid'])}">
				<div class="i_info_counts_title">微博</div>
				<div class="i_info_counts_num">{$profile.count_info.feed_count}</div>
			</div>
			<div id="i_info_counts_box_guanzhu" class="{$iicb}" uid="{$profile.uid}" linkto="{:U('w3g/Index/following','uid='.$profile['uid'])}">
				<div class="i_info_counts_title">关注</div>
				<div class="i_info_counts_num">{$profile.count_info.following_count}</div>
			</div>
			<div id="i_info_counts_box_fensi" class="{$iicb}" linkto="{:U('w3g/Index/followers','uid='.$profile['uid'])}">
				<div class="i_info_counts_title">粉丝</div>
				<div class="i_info_counts_num">{$profile.count_info.follower_count}</div>
			</div>
			<php>if($profile['uid']==$_SESSION['mid']){</php>
			<div id="i_info_counts_box_shoucang" class="{$iicb}" linkto="{:U('w3g/Index/favorite')}">
				<div class="i_info_counts_title">收藏</div>
				<div class="i_info_counts_num">{$profile.count_info.favorite_count}</div>
			</div>
			<php>}</php>
		</div>
	</div>
	<!-- 个人信息结束 -->



	<!-- <div id="feed_nav">
		<div id="feed_nav_i_weibo" class="feed_nav_sort_i">我的微博⊿</div>
		<div id="feed_nav_i_info" class="feed_nav_sort_i">我的资料</div>
	</div> -->
	<!-- big!box -->
	<volist name='weibolist' id='myfeed'>
		<div class="cob">
		<div class="c" isdig="{$myfeed['is_digg']}" cid="{$myfeed['feed_id']}" rowid="{$myfeed.feed_id}" appid="{$myfeed.uid}" page="">
			<!-- 判断是否被收藏 -->
			<php>if($myfeed['favorited']==1){</php>
				<div class="sc sc_1" id="sc_{$myfeed.feed_id}" cid="{$myfeed.feed_id}" type="{$feed.type}" type="{$feed.app_row_table}"></div>
			<php>}else{</php>
				<div class="sc" id="sc_{$myfeed.feed_id}" cid="{$myfeed.feed_id}" type="{$feed.type}" type="{$feed.app_row_table}"></div>
			<php>}</php>
			<div class="c_info">
				<div class="c_ava">
					<img src="{$myfeed['avatar_small']}" width=40 height=40>
				</div>
				<div class="info_text">
					<div class="c_info_name">{$myfeed['uname']}</div>
					<div class="c_info_more_box">
						<div class="c_time">{$myfeed['publish_time']|FriendlyDate}</div>
						<div class="c_digg_count">赞：{$myfeed['digg_count']}</div>
						<div class="c_zf_count">转发：{$myfeed['repost_count']}</div>
						<div class="c_comment_count">评论：{$myfeed['comment_count']}</div>
					</div>
				</div>
			</div>
			<div class="c_content">
				<php>echo wapFormatContent($myfeed['feed_content']);</php>
				<php>if($myfeed['type'] == 'weiba_post'){</php>
				<div class="loadweiba" weibaid="{$myfeed.api_source.post_id}">查看全文</div>
				<php>}</php>
			</div>
			<!-- 原微博的图 -->
			<php>if($myfeed['feedType']=='postimage') {</php>
			<div class="feed_img_box">
				<php>foreach($myfeed['attach'] as $value){</php>
					<img bm="{$value['attach_middle']}" class="feed_img" src="{$value['attach_url']}" linkto="{:U('w3g/Index/detail',array('weibo_id'=>$myfeed['weibo_id']))}">
				<php>}</php>
			</div>
			<php>}</php>
			<!-- 转发 -->
			<php>if ($myfeed['type'] == 'repost') {</php>
				<div class="c_zf_box">
					<dt class="bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt>
					<div class="c_zf_content">
						<span class="c_zf_content_name">@{$myfeed.transpond_data.uname}</span>:
						<php>echo wapFormatContent($myfeed[transpond_data][feed_content]);</php>
						<php>if($myfeed['transpond_data']['type'] == 'weiba_post'){</php>
						<div class="loadweiba" weibaid="{$feed.transpond_data.api_source.post_id}">查看全文</div>
						<php>}</php>
					</div>
					
					<!-- 转发的图 -->
					<php>if($myfeed['transpond_data']['type']=='postimage') {</php>
						<div class="feed_img_box">
							<php>foreach($myfeed['transpond_data']['attach'] as $value){</php>
							<img bm="{$value['attach_middle']}" class="feed_img" src="{$value['attach_url']}" linkto="{:U('w3g/Index/detail',array('weibo_id'=>$myfeed['weibo_id']))}">
							<php>}</php>
						</div>
					<php>}</php>
					<div class="c_zf_info">
						<div class="c_zf_info_time">{$myfeed.transpond_data.publish_time|friendlyDate}</div>
						<div class="c_zf_info_counts">
							<span class="c_zf_info_count">转发：{$myfeed.transpond_data.repost_count}</span>
							<span class="c_zf_info_count">评论：{$myfeed.transpond_data.comment_count}</span>
							<span class="c_zf_info_count">赞：{$myfeed.transpond_data.digg_count}</span>
						</div>
					</div>
					<!-- 附件 -->
					<div ><php>if(isset($myfeed['transpond_data']['attach']) && $myfeed['transpond_data']['type'] == 'postfile'){</php>
						<div class="attach_box">
							<php>foreach($myfeed['transpond_data']['attach'] as $value){
									switch($value['extension']){
										case 'png':$type='pic';break;
										case 'jpg':$type='pic';break;
										case 'jpeg':$type='pic';break;
										case 'bmp':$type='pic';break;
										case 'gif':$type='pic';break;
										case 'zip':$type='zip';break;
										case 'rar':$type='zip';break;
										case 'doc':$type='word';break;
										case 'docx':$type='word';break;
										case 'xls':$type='xls';break;
										case 'ppt':$type='ppt';break;
										case 'pdf':$type='pdf';break;
										default:$type='unknow';break;
									}
									$size=$value['size'];
									if($size > 1024 && $size< 1024*1024){
										$size=$size/1024;
										$size=round($size,2);
										$size.='K';
									}else if($size < 1024){
										$size.='B';
									}else{
										$size=$size/1024/1024;
										$size=round($size,2);
										$size.='M';
									}
							</php>
								<a class="attachs_a" href="{:U('widget/Upload/down',array('attach_id'=>$value['attach_id']))}" type="<php>echo $value['extension'];</php>">
									<div class="attachs" style="background-image:url(img/attach/{$type}.png)">
										<div class="attachs_name">
											<php>echo $value['attach_name'];</php>
										</div>
										<div class="attachs_size">
											<php>echo $size;</php>
										</div>
									</div>
								</a>
							<php>}</php>
						</div>
					  <php>}</php>
					</div>
				</div>
			<php>}</php>
			<!-- 微吧转发 -->
			<php>if ($myfeed['type'] == 'weiba_repost') {</php>
			<div id="c_zf_box_{$myfeed.feed_id}" class="c_zf_box">
				<dt class="bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt>
				<div class="c_zf_content">
					<span class="c_zf_content_name">@{$myfeed.api_source.source_user_info.uname}</span>:
					<php>echo wapFormatContent($myfeed['api_source']['source_content']);</php>
				</div>
				<div class="c_zf_info">
					<div class="c_zf_info_time">{$myfeed[api_source][post_time]|friendlyDate}</div>
					<div class="c_zf_info_counts">
						<span class="c_zf_info_count">评论:{$myfeed[api_source][reply_count]}</span>
					</div>
				</div>
				<div class="loadweiba" weibaid="{$myfeed.api_source.post_id}">查看全文</div>
			</div>
			<php>}</php>

			<div ><php>if(isset($myfeed['attach']) && $myfeed['type'] == 'postfile'){</php>
						<div class="attach_box">
							<php>foreach($myfeed['attach'] as $value){
									switch($value['extension']){
										case 'png':$type='pic';break;
										case 'jpg':$type='pic';break;
										case 'jpeg':$type='pic';break;
										case 'bmp':$type='pic';break;
										case 'gif':$type='pic';break;
										case 'zip':$type='zip';break;
										case 'rar':$type='zip';break;
										case 'doc':$type='word';break;
										case 'docx':$type='word';break;
										case 'xls':$type='xls';break;
										case 'ppt':$type='ppt';break;
										case 'pdf':$type='pdf';break;
										default:$type='unknow';break;
									}
									$size=$value['size'];
									if($size > 1024 && $size< 1024*1024){
										$size=$size/1024;
										$size=round($size,2);
										$size.='K';
									}else if($size < 1024){
										$size.='B';
									}else{
										$size=$size/1024/1024;
										$size=round($size,2);
										$size.='M';
									}
							</php>
								<a class="attachs_a" href="{:U('widget/Upload/down',array('attach_id'=>$value['attach_id']))}" type="<php>echo $value['extension'];</php>">
									<div class="attachs" style="background-image:url(img/attach/{$type}.png)">
										<div class="attachs_name">
											<php>echo $value['attach_name'];</php>
										</div>
										<div class="attachs_size">
											<php>echo $size;</php>
										</div>
									</div>
								</a>
							<php>}</php>
						</div>
				  <php>}</php>
			</div>
		</div>
		<div class="c_d">
			<div class="c_d_yes">
				<div class="c_d_text">
					删除
				</div>
			</div>
			<div class="c_d_no">
				<div class="c_d_text">
					取消
				</div>
			</div>
		</div>
	</div><!--.cob end-->
	</volist>
	<!-- 分页 -->
	<div id="pager_box">
		<php>if(empty($_GET['page']) || $_GET['page']==1){</php>
			<a href="javascript:;" link="" id="prev" class="pager_child pager_p_n_none ">上一页</a>
		<php>}else{</php>
			<a href="javascript:;" link="{:U('w3g/Index/favorite',array('page'=>$page-1))}" id="prev" class="pager_child pager_p_n ">上一页</a>
		<php>}</php>
		<select id="page_sel" class="pager_child">
			<php>
				$_GET['page']!=0?$get=$_GET['page']:$get=1;
				$_count = ceil($count/10);
				if($get<6){
					for($i=0;$i<($_count);$i++){
						$get==$i+1?$selected='selected="selected"':$selected='';
						if($i>9){
							break;
						}
			</php>
			<option value="{:U('w3g/Index/favorite')}&page={$i+1}" <php>echo $selected;</php>>第{$i+1}页</option>
			<php>	}
				}elseif($get>=6){
					for($i=($get-5);$i<$get;$i++){
						$get==$i+1?$selected='selected="selected"':$selected='';
			</php>
			<option value="{:U('w3g/Index/favorite')}&page={$i+1}" <php>echo $selected;</php>>第{$i+1}页</option>
			<php>	}</php>
			<php>	for($i=$get;$i<($get+5);$i++){
						$get==$i+1?$selected='selected="selected"':$selected='';
						if($i>$_count-1){
							break;
						}
			</php>
			<option value="{:U('w3g/Index/favorite')}&page={$i+1}" <php>echo $selected;</php>>第{$i+1}页</option>
			<php>	}</php>
			<php>}</php>
			
		</select>
		<php>if($get == $_count) {</php>
			<a href="javascript:;" link="" id="next" class="pager_child pager_p_n_none">下一页</a>
		<php>}else{</php>
			<a href="javascript:;" link="{:U('w3g/Index/favorite',array('page'=>$page+1))}" id="next" class="pager_child pager_p_n">下一页</a>
		<php>}</php>
	</div>
	</div>
	<!-- bog!box end -->
	<!-- 列表结束################################################################################################ -->
	<include file="../Public/footer" />